package cc.jq1024.infrastructure.persistent.dao;

import cc.jq1024.infrastructure.persistent.po.RaffleActivityOrderPO;
import cc.jq1024.router.annotation.DBRouter;
import cc.jq1024.router.annotation.DBRouterStrategy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 抽奖活动单 Mapper 接口
 * </p>
 *
 * @author lijiaqiang@ljq1024.cc
 * @since 2024-04-23
 */
@Mapper
@DBRouterStrategy(splitTable = true)
public interface IRaffleActivityOrderDao extends BaseMapper<RaffleActivityOrderPO> {

    /** 插入订单  */
    void insertOne(RaffleActivityOrderPO raffleActivityOrder);

    /** 查询订单列表 */
    @DBRouter(key = "userId")
    List<RaffleActivityOrderPO> queryRaffleActivityOrderByUserId(String userId);

    /** 查询订单 */
    @DBRouter
    RaffleActivityOrderPO queryRaffleActivityOrder(RaffleActivityOrderPO raffleActivityOrderReq);

    /** 更新订单 */
    int updateOrderCompleted(RaffleActivityOrderPO raffleActivityOrderReq);

    /** 查询未支付订单 */
    @DBRouter
    RaffleActivityOrderPO queryUnpaidActivityOrder(RaffleActivityOrderPO raffleActivityOrderReq);
}
